package test11;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-11-07
 * Time: 9:18
 */
public class Test {
    public static void main(String[] args) throws IOException {
        int i;
        FileInputStream fin;
        FileOutputStream fout;
        fin = new FileInputStream("myfile.txt");
        fout = new FileOutputStream("youfile.txt");
        do {
            i = fin.read();
            if (i != -1) {
                fout.write(i);
            }
        }while(i!=-1);
        fin.close();
        fout.close();
        System.out.println("已经拷贝完成");

    }
}
